﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class UserWork_EvectionRegister : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

       
    }
    protected void bnSave_ServerClick(object sender, EventArgs e)
    {
        if (txArea.Value.Trim() == "" || this.txContent.Value.Trim() == "" || TextBox1.Text.Trim() == "" || TextBox2.Text.Trim() == "")
        {
            Response.Write("<script>alert('请输入详细信息！')</script>");
        }
        else
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
            con.Open();
            string sql = "insert Evection values('" + this.txArea.Value.Trim()+ "','" + this.TextBox1.Text.Trim() + "','" + TextBox2.Text.Trim() + "','" + this.txContent.Value.Trim() + "','" + Session["UserName"].ToString() + "')";
            SqlCommand com = new SqlCommand(sql, con);
            com.ExecuteNonQuery();
            Response.Write("<script>alert('登记成功！！');window.location.href='ErrandList.aspx';</script>");
            con.Close();
        }
    }
}
